package com.fxd.serviceorder.feign.fallback;

import com.fxd.model.product.bean.Product;
import com.fxd.serviceorder.feign.ProductFeignClient;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @author xudongfu
 * @date 2025/06/12
 */
@Component
public class ProductFeignClientFallBack implements ProductFeignClient {

    @Override
    public Product getProductById(Long id) {
        System.out.println("兜底回调....");
        Product product = new Product();
        product.setId(id);
        product.setPrice(new BigDecimal("0"));
        product.setProductName("未知商品");
        product.setNum(0);

        return product;
    }
}
